A Habitat represents a physical zone or enclosure within the park where animals live. Each habitat belongs to a Section — the top-level organizational area of the park — and tracks how many animals it currently houses.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Fer-2202/Proyecto_Final/llms.txt
Use this file to discover all available pages before exploring further.
All write operations (POST, PUT, DELETE) require authentication via
IsAuthenticatedAndRole. GET endpoints return data publicly.Endpoints
List habitats
Returns all habitats ordered alphabetically by name.Response fields
Unique identifier for the habitat.
Name of the habitat. Maximum 30 characters. Must be unique across all habitats. Records are ordered alphabetically by this field.
Current number of animals housed in this habitat. Must be a positive integer.
Short description of the habitat. Maximum 100 characters.
Foreign key referencing the parent
Sections record. Deleting a section cascades to its habitats.Create habitat
Requires admin authentication.
Name of the habitat. Maximum 30 characters. Must be unique.
Initial animal count for this habitat. Must be zero or greater.
Short description. Maximum 100 characters.
ID of the parent section.
Retrieve habitat
Primary key of the habitat.
Update habitat
Requires admin authentication. Only PUT is supported; PATCH is not exposed.
Primary key of the habitat to update.
Updated habitat name. Maximum 30 characters.
Updated animal count.
Updated description. Maximum 100 characters.
Updated parent section ID.
Delete habitat
Requires admin authentication.
Primary key of the habitat to delete.
Relationship to species
Habitats do not directly reference species in the data model. The relationship is established through theAnimals resource: each animal belongs to one habitat and one species. To find all species present in a given habitat, query /api/animals/?habitat={id} and inspect the species field on each result.
